﻿
CREATE PROCEDURE [dbo].[GetCargoRow]
	(	@Cargo_ID int,
		@PageIndex int,
		@PageSize  int
		)	
AS
BEGIN
	create table #tempTable (CargoID int,
	Name nchar(100),
	Description nchar(200),
	ShortCode nchar(5),
	Code nchar(6),
	ETSNGName  nchar(200),
	CodeGNG  nchar(200),
	GNGName nchar(200),
	nemocode nchar(200),
	IsUsed bit,
	IsEmpty bit)

	DECLARE @Index1 int
    DECLARE @PageSize1 int

    set @Index1 = @PageIndex
    set @PageSize1 = @PageSize


	insert into #tempTable (CargoID,
	Name,
	Description,
	ShortCode,
	Code,
	ETSNGName,
	CodeGNG,
	GNGName,
	nemocode,
	IsUsed,
	IsEmpty) exec  dbo.GetCargo @Index1, @PageSize1 

	SET NOCOUNT ON;
	SELECT * From  #tempTable Where #tempTable.CargoID = @Cargo_ID;
	drop table #tempTable;
END